package com.micro.ai.files.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 文件存储配置实体类
 * 
 * @author micro-ai
 * @since 0.0.1
 */
@Data
@TableName("storage_configs")
@Schema(description = "文件存储配置信息")
public class StorageConfig implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @Schema(description = "配置ID", example = "config_123456789")
    private String id;

    /**
     * 租户ID
     */
    @Schema(description = "租户ID", example = "tenant_001")
    private String tenantId;

    /**
     * 存储提供商：local-本地, s3-AWS S3, oss-阿里云OSS, cos-腾讯云COS, minio-MinIO
     */
    @Schema(description = "存储提供商", example = "minio", allowableValues = {"local", "s3", "oss", "cos", "minio"})
    private String provider;

    /**
     * 配置名称
     */
    @Schema(description = "配置名称", example = "AWS S3 主存储")
    private String configName;

    /**
     * 服务端点（如S3的endpoint）
     */
    @Schema(description = "服务端点", example = "s3.amazonaws.com")
    private String endpoint;

    /**
     * 区域
     */
    @Schema(description = "区域", example = "us-east-1")
    private String region;

    /**
     * 存储桶名称
     */
    @Schema(description = "存储桶名称", example = "my-bucket")
    private String bucketName;

    /**
     * 访问密钥（加密存储）
     */
    @Schema(description = "访问密钥（加密）")
    private String accessKeyEncrypted;

    /**
     * 密钥（加密存储）
     */
    @Schema(description = "密钥（加密）")
    private String secretKeyEncrypted;

    /**
     * 是否默认配置
     */
    @Schema(description = "是否默认配置", example = "true")
    private Boolean isDefault;

    /**
     * 访问基础URL
     */
    @Schema(description = "访问基础URL", example = "https://cdn.example.com")
    private String baseUrl;

    /**
     * 状态：active-活跃, inactive-停用
     */
    @Schema(description = "状态", example = "active", allowableValues = {"active", "inactive"})
    private String status;

    /**
     * 创建人ID
     */
    @Schema(description = "创建人ID", example = "user_001")
    private String createdBy;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    @Schema(description = "创建时间", example = "2025-01-01 00:00:00")
    private LocalDateTime createdAt;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @Schema(description = "更新时间", example = "2025-01-01 00:00:00")
    private LocalDateTime updatedAt;
}

